// This legacy file is to preserve style for apps pre-1.3
// @depreciation - This file should be deleted ENTIRELY in v2.0 (TS)

.main_table-header-modified {
  width: 200px;
  text-align: center;
}

.main_table-header-clone {
  text-align: center;
}

.main_table-header-live {
  width: 80px;
  text-align: center;
}

.main_table-header-delete {
  width: 90px;
  text-align: center;
}

.main_table-header-edit,
.main_table-header-clone {
  width: 65px;
  text-align: center;
}

.main_table-edit,
.main_table-delete {
  width: 1px;
  text-align: center;

  a {
    color: $c-text-sub;

    &:hover {
      color: $c-text;
    }
  }
}

// content secitons

.sidenav {
  ~ .simple_form {
      .main_content-header {
        @include bp(large) {
          width: 100vw;
          margin-left: -($sidenav-width + $content-buffer);

          // If sticky, remove extra margin
          // Note: this will break if nav is stuck at page load
          &.js-sticky {
            margin-left: 0;
          }
        }
      }
  }
  ~ .main_content-sections {
    @include bp(large) {
      // .content adds a 30px buffer in 1.3 <=
      padding-left: $sidenav-width + $content-buffer - 30px;
    }
  }
}

.main_content-section {
  width: 100%;

  &.extra-bottom-padding {
    padding-bottom: 200px;
  }
}

.main_content-section-area {
  @extend .content;
}

.main_content-section-title {
  padding: 17px 40px;
  color: pickForegroundColor($c-custom-highlight, $c-white, $c-black);
  background: $c-custom-highlight;
  border-top: 1px solid $c-border;
  text-transform: uppercase;
  font-size: 14px;
  letter-spacing: .2em;

  .main_content-section:first-child & {
    border-top: 0;
  }
}

.main_table-clone {
  text-align: center;
}

.main_table-action {

  &.main_table-clone {
    display: block;
    width: 34px;
    margin: 0 auto;
  }

  .icon-edit {
    font-size: 15px;
  }

}

tbody {
  tr {
    &:nth-of-type(even) {
      .main_table-action {
        border-color: $c-table-tr-even;

        &:hover {
          border-color: $c-mid-grey;
        }
      }
    }
  }
}

// Styles needed for the fileinputer
.file_input-wrapper {
  @include transition(background .2s);
  position: relative;
  display: inline-block;
  width: 90%;
  min-width: 223px;
  max-width: 515px;
  padding: 5px;
  border: 1px solid $c-border;
  background: $c-body-bg;
  font-size: 13px;
  cursor: pointer;
  border-radius: 2px;

  &.js-active {
    background: $c-white;
  }

  span {
    @include transition(color .2s);
    color: $c-text-sub;
  }
}

.main_content-section-toggles {
  list-style: none;
  margin: -16px negate($content-buffer) 5px;
  padding: 0 $content-buffer;

  li {
    display: inline-block;

    a {
      @include transition(color 0s, background 0.4s);
      display: block;
      padding: 11px 13px 10px;
      color: $c-text-sub;
      font-size: 13px;
      border-radius: 0 0 3px 3px;

      &.active,
      &:hover {
        background: $c-custom-highlight;
        color: $c-white;
      }
    }
  }
}

.main_content-sortable-handle-col {
  width: 25px;
  padding: 0;
}

.main_content-sortable-handle {
  padding-right: 5px;
  color: $c-text-sub;
  cursor: pointer;
}

.form_content-wrapper {
  padding: 30px 30px 30px 40px;
  border: 1px solid $c-grey;
  border-top: 0;
  background: $c-form-table-bg;

  h2 {
    margin-bottom: 20px;
    font-size: 16px;
    color: $c-text-heavy;
    font-weight: bold;
    letter-spacing: 0;
    text-transform: none;
    border: 0;
    padding: 0;
    margin: 0 auto 30px;
    background: none;
  }
}

///////////////////////////////
//   Hacks to fix updates    //
///////////////////////////////

.content {
  .main_content-section-area {
    padding: 0;
  }
}

.main_content-section {
  .js-addedit-form {
    @extend .content;
    padding-bottom: 20px;

    .form_content-wrapper {
      h2 {
        color: $c-text-heavy;
        letter-spacing: 0;
        text-transform: none;
        border: 0;
        padding: 0;
        margin: 0 auto 30px;
        background: none;
      }
    }
  }
}

// content header
.main_content-header {
  @include stack($fae-nav-stack, '.content-header');
  @include clearfix;

  width: 100%;
  padding: 15px $content-buffer;
  background: $c-content-header-bg;
  border-bottom: 1px solid $c-border;
  top: 0;

  h1 {
    padding: 5px 0;
    font-weight: bold;

    @include bp(large) {
      float: left;
    }
  }
}

.main_content-header-wrapper {
  @include clearfix;
  position: relative;

  h1,
  ul {
    display: inline-block;
  }
}

.main_content-breadcrumbs {
  padding-bottom: 5px;
}

.main_content-header-save,
.main_content-header-csv {
  margin-top: 30px;

  @include bp(medium) {
    position: absolute;
    right: 30px;
    bottom: 22px;
    margin-top: 0;
  }

  @include bp(page_header_save_block) {
    position: relative;
    top: 0;
    padding-bottom: 10px;
  }

  .main_content-header-section + & {
    margin-bottom: 30px;
  }
}

.main_content-header-csv {
  @include bp(medium) {
    right: 155px;
  }
}

.main_content-header-save {
  a:not(.add-button) {
    @include gradient-vertical($start-color: $c-light-button-gradient-start, $end-color: $c-light-button-gradient-end);
    border-radius: 3px;
    color: $c-light-button;
    border: 1px solid $c-border;
    padding: 11px 14px;
    cursor: pointer;
    font-size: 13px;
    margin-right: 5px;

    &:hover {
      background: $c-light-button-gradient-end;
    }
  }

  input[type=submit] {
    padding: 10px 14px 11px;
  }

  .clone-button{
    font-size: 13px;
    margin-left: 5px;
  }
}

.main_content-header-section-links {
  margin-top: 5px;

  @include bp(large) {
    margin-bottom: -15px;
  }

  a {
    @include transition(all .2s);
    display: inline-block;
    vertical-align: top;
    padding: 8px 0;
    border-bottom: 5px solid $c-content-header-bg;
    margin: 0 8px;
    font-size: 13px;
    color: $c-text-sub;

    &:hover {
      color: $c-text-heavy;
      border-bottom-color: $c-custom-highlight;
    }
  }

  li {
    display: inline-block;
    vertical-align: top;

    &:first-child {
      a {
        margin-left: 0;
      }
    }

    &.-active {
      a {
        color: $c-text-heavy;
        border-bottom-color: $c-custom-highlight;
      }
    }
  }
}

.content-header-buttons {
  ~ .main_content-header-save {
    display: none;
  }
}


///////////////////////////////
// Elements not found in Fae //
///////////////////////////////



.main_table-description-item-sub {
  margin-top: 7px;
  font-size: 12px;
  color: $c-text-sub;
}

.main_table-modified {
  text-align: center;
}

.main_table-live {
  font-weight: bold;
  text-align: center;
}

.main_table-action_menu-trigger {
  @include transition(color .2s);
  padding: 8px 10px;
  font-size: 20px;
  color: $c-text-sub;
  cursor: pointer;

  &.js-active {
    color: $c-text;
  }
}

.main_table-action_menu-content {
  @include transition(opacity .2s);
  position: absolute;
  top: 42px;
  left: -9999px;
  width: 150px;
  padding: 10px 0;
  opacity: 0;
  background: $c-white;
  box-shadow: 0 0 5px 1px $c-box_shadow;

  li {
    padding: 7px 20px;
    font-size: 14px;
    color: $c-custom-highlight;
    cursor: pointer;

    &:hover {
      background: $c-white;
    }
  }

  .js-active + & {
    right: 0;
    left: auto;
    opacity: 1;
  }
}

.main_table-action_menu {
  position: relative;
  display: inline-block;
  float: right;
  border: 1px solid $c-border;
  margin-bottom: 10px;

  border-radius: 2px;

  .icon-arrow_down {
    font-size: 4px;
    vertical-align: middle;
  }

  .icon-settings {
    font-size: 18px;
    vertical-align: middle;
  }
}

.main_table-action-area {
  float: right;
  margin-bottom: 10px;
}

.main_content-section-sub {
  margin-top: 50px;

  &:first-child {
    margin-top: 0;
  }
}

// Button Menu Dropdown
.button-dropdown.button-dropdown {
  @extend button[type=button];
  position: relative;
  padding: 9px 11px;
  z-index: 1;

  &:after {
    @include icon-stuff;
    content: fae-icon(arrow_down);
    vertical-align: middle;
    font-size: 5px;
    color: $c-text-sub;
  }

  &:hover {
    &:after, .icon-settings {
      color: $c-mid-dark-grey;
    }
  }

  .icon-settings {
    font-size: 17px;
    vertical-align: middle;
    color: $c-text-sub;
  }

  .button-dropdown-menu {
    display: none;
  }
}

.button-dropdown-menu {
  position: absolute;
  right: 0;
  top: 40px;
  width: 240px;
  padding: 9px 15px;
  background: $c-white;
  z-index: 1;
  text-align: left;
  box-shadow: 0 0 5px 1px $c-box_shadow;

  a {
    display: block;
    padding: 5px;
    color: $c-text;
  }
}

.button-dropdown--opened.button-dropdown--opened {
  &:after,
  .icon-settings {
    color: $c-mid-dark-grey;
  }

  .button-dropdown-menu {
    display: block;
  }
}

.table-button-dropdown {
  float: right;
  position: relative;
  bottom: 10px;
}

.sample {
  .notice {
    display: block!important;
    height: 58px !important;
  }

  .error {
    padding: 20px;
    border-style: solid;
    border-left-width: 3px;
    border-color: $c-warning-content;
    background: $c-warning-bg;
    color: $c-warning-content;

    &:before {
      @include icon-stuff;
      content: fae-icon(alert);
      margin-right: 10px;
    }

    + .content.content {
      padding-top: 0;
    }
  }
}

// used for the sample pages only
.sample-modals {
  .simplemodal-container {
    width: 400px;
  }
}

.sidenav-third-link {
  @include bp(large) {
    padding: 10px 10px 10px 30px;
  }
}

.form_content-wrapper-visible {
  padding: 30px;
  border: 1px solid $c-border;
  border-top: 0;
  background: $c-form-table-bg;

  .input {
    display: inline-block;
    vertical-align: top;
    margin: 0;
  }

  .select .chosen-container-single .chosen-single {
    padding: 8px 15px;
  }
}

.form_content-wrapper-visible-complex {
  padding: 30px;
  border: 1px solid $c-border;
  border-top: 0;
  background: $c-form-table-bg;

  .select .chosen-container-single .chosen-single {
    padding: 8px 15px;
  }
}

.table-add-link-visible {
  float: right;
  font-size: 12px;
}

.main_content-header-delete {
  color: #ce0202;
  margin-right: 20px;

  &:before {
    @include icon-stuff;
    content: fae-icon(delete_x);
    font-size: 12px;
    margin-right: 6px;
  }
}

.login-label-extra {
  margin-bottom: 10px;
  font-weight: bold;
  font-size: 15px;
  color: $c-text-heavy;
}

.checkbox_styled {
  display: inline-block;

  input[type=checkbox] {
    position: absolute;
    left: -9999px;
    top: -9999px;
    visibility: hidden;
  }

  .checkbox {
    display: inline-block;
    height: 20px;
    width: 20px;
    padding: 2px 0 0 2px;
    border: 1px solid $c-border;
    margin-bottom: 0;
    font-size: 13px;
    color: $c-text-heavy;
    background: $c-white;
    cursor: pointer;

    border-radius: 2px;

    &:before {
      visibility: hidden;
    }

    &.js-active:before {
      visibility: visible;
    }
  }
}
